<?php $atr=array(
					"name"=>"contract",
					"onsubmit"=>"return checkContract()"
				  ); 
echo form_open('contract',$atr); ?> 
  
<?php $bar="Contract List";?>
<table id="box-table-a" cellspacing="1" align="right" width="900px">
 	<tr><td colspan=8 align=right class=bar><?php echo $bar;?></td></tr>
   		<tr>
   			<th>Contract_ID</th>
   			<th>Staff_ID</th>
   			<th>FullName</th>
   			<th>EffectiveDate</th>
   			<th>Location</th> 
   			<th>Department_ID</th>
			<th>Session_ID</th>   
			<th>Action</th>			  			
   		</tr> 		
 		
<?php if (isset($result)){?>
   	
   		<?php foreach ($result as $row):?> 
		<tr>
			<?php //$this->session->set_userdata('Customer_ID', $row->Customer_ID);?>			
			<td class="row1"><?php echo $row->Contract_ID; ?> </td>
			<td class="row1"><?php echo $row->Staff_ID ;?> </td>
			<td class="row1"><?php echo $row->FullName ;?> </td>
			<td class="row1"><?php echo $row->EffectiveDate;?> </td>
			<td class="row1"><?php echo $row->Location;?> </td>
			<td class="row1"><?php echo $row->Department_ID;?> </td>
			<td class="row1"><?php echo $row->Session_ID;?> </td>
			<td class="row1" align="center">
				 <?php echo '<id=a>'.anchor("contract/edit/$row->Contract_ID",'<img src ="'.base_url().'templates/images/icons/edit.gif" title="Click here to modify"/>').'</a>';?>				 
				 <?php echo '<id=a> '.anchor("contract/view/$row->Contract_ID",'<img src ="'.base_url().'templates/images/icons/view.gif" title="Click here to view"/>').'</a>';?> 
				 <?php echo '<id=a  onclick="return checkLink();">'.anchor("contract/delete/$row->Contract_ID",'<img src ="'.base_url().'templates/images/icons/delete.png" title="Click here to delete"/>').'</a>';?>
			</td>			
		</tr>	   
 		<?php endforeach; ?>				
   		<tr>   			
   			<td colspan=8 align=center >   				
   				<?php echo '<id=a>'.anchor("contract/insert",'<img src ="'.base_url().'templates/images/icons/addstaff.jpeg" width=60 height=40 title="Click here to addcontract"/>').'</a>';?>
   			</td>
   		</tr>
   		<tr>
   			<td colspan="8">	<?php echo $this->pagination->create_links(); // tạo link phân trang?>  </td>
   		</tr>
   		<tr>
   			<td colspan="8" id="abc"> 
   				<?php if (isset($error)){
					echo "<br/>";   			
			   		echo $error;
					echo '<br/>';
					form_close();
		   		}?>
		   		
		   	 </td>
   		</tr>
		
 </table>      	
   			
      	
 <?php }?>


